(function() {

	return function(req, service) {
		if (req.path == '/queryXml') {
			var xpath = req.params.getFirst('xpath');
			var xml = req.content.value;
			console.info('xml ', xml);
			var obj = new XMLParser.parse(xml);
			obj = obj.find(xpath);
			return new Response({
				request : req,
				code : 200,
				contentType : 'text/plain',
				content : {
					type : 'text',
					value : obj.content
				}
			});
		}

		return service(req);
	}

})();
